import { Injectable } from '@angular/core';
import {HostService} from "./host.service";
import {HttpClient} from "@angular/common/http";
import {CustomLoginForm} from "../to/CustomLoginForm";

@Injectable({
  providedIn: 'root'
})
export class CustomService {

  userid:string;
  token:string


  constructor(private host:HostService,private http:HttpClient) {

  }

  private getCustomTokenURL=this.host.IM_HOST+"public/getCustomToken";
  getCustomToken(f:CustomLoginForm){

    return this.http.post(this.getCustomTokenURL,f).toPromise();

  }


  private gererateAdminTokenURL=this.host.IM_HOST+"public/gererateAdminToken";
  gererateAdminToken(f:CustomLoginForm){
    return this.http.post(this.gererateAdminTokenURL,f).toPromise();
  }


}
